import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'page',
    component: () => import(/* webpackChunkName: "page" */ '@/views/page/index.vue'),
    redirect: '/cribs',
    children: [
      {
        path: 'correspondence',
        name: 'correspondence',
        component: () => import(/* webpackChunkName: "home" */ '@/views/correspondence/index.vue'),
      },
      {
        path: 'cribs',
        name: 'cribs',
        component: () => import(/* webpackChunkName: "home" */ '@/views/cribs/index.vue'),
      },
      {
        path: 'settings',
        name: 'settings',
        component: () => import(/* webpackChunkName: "home" */ '@/views/setting/index.vue'),
      },
      {
        path: 'personal-setting',
        name: 'personal-setting',
        component: () => import(/* webpackChunkName: "home" */ '@/views/personal-setting/index.vue'),
      },
      {
        path: 'profiles',
        name: 'profiles',
        component: () => import(/* webpackChunkName: "home" */ '@/views/profiles/index'),
      },
      {
        path: 'sender',
        name: 'sender',
        component: () => import(/* webpackChunkName: "home" */ '@/views/sender/index'),
      },
      {
        path: 'icebreakers',
        name: 'icebreakers',
        component: () => import(/* webpackChunkName: "home" */ '@/views/icebreakers/index'),
      },
      {
        path: 'news-feed',
        name: 'news-feed',
        component: () => import(/* webpackChunkName: "home" */ '@/views/news-feed/index'),
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */ '@/views/login')
  }
]

const router = new VueRouter({
  routes
})

export default router
